package com.novel.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;import com.novel.entiy.Novel;
import java.util.Date;import java.util.List;
import com.novel.entiy.dto.NovelPageDTO;import com.novel.entiy.dto.ReadDTO;
import com.novel.entiy.dto.StatisticsDTO;
import com.novel.entiy.vo.BookSelfVO;
import com.novel.entiy.vo.StatisticsVO;
import org.apache.ibatis.annotations.Param;

/**
 * @author tanghao
 * @date 2022/4/8
 */
public interface NovelMapper extends BaseMapper<Novel> {
    int updateBatch(List<Novel> list);

    int batchInsert(@Param("list") List<Novel> list);

    int readRecordExist(Long novelId, Long id);

    void read(Long novelId, Long id, Long chapterId, int i, Date date);

    int readChapterRecordExist(ReadDTO readDTO);

    Page<Novel> getNovelList(Page<Object> objectPage, @Param("query") NovelPageDTO novelPageDTO);

    Page<BookSelfVO> getMyBookSelf(Page<Object> objectPage, Long id);

    Long getRecentReadChapter(Long id, Long userInfoId);

    Page<StatisticsVO> statisticsPage(Page<Object> objectPage, @Param("query") StatisticsDTO statisticsDTO);
}